how to call the function in javascript